<template>
  <div>life</div>
  <div @click="addCount">{{ count }}</div>
</template>

<script>
import { reactive, toRefs, onMounted, onUpdated } from "vue";
export default {
  setup() {
    const state = reactive({
      count: 1,
      addCount() {
        state.count++;
      },
    });
    const refState = toRefs(state);
    onMounted(() => {
      console.log("onMounted");
    });
    onUpdated(() => {
      console.log("onUpdated");
    });
    return {
      ...refState,
    };
  },
};
</script>

<style>
</style>